
<!DOCTYPE html>
<html class="client-nojs" lang="en" dir="ltr">
<head>
<meta charset="UTF-8"/>
<title>Hugin Mask tab - PanoTools.org Wiki</title>




<style media="screen" type="text/css" title="Screen style sheet"> @import url(manual.css); </style>

<meta name="generator" content="MediaWiki 1.35.3"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>





<!--[if lt IE 9]><![endif]-->
</head>
<body class="mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Hugin_Mask_tab rootpage-Hugin_Mask_tab skin-vector action-view skin-vector-legacy">


<div id="content" class="mw-body" role="main">
	<a id="top"></a>
	
	
	<h1 id="firstHeading" class="firstHeading" lang="en">Hugin Mask tab</h1>
	<div id="bodyContent" class="mw-body-content">
		<div id="siteSub" class="noprint">From PanoTools.org Wiki</div>
		
		
		
		
		
		
		<div id="mw-content-text" lang="en" dir="ltr" class="mw-content-ltr"><div class="mw-parser-output"><table cellspacing="0" cellpadding="0" style="clear: right; margin-bottom: .5em; float: right; padding: .5em 0 .8em 1.4em; background: none; width:auto">
<tbody><tr>
<td><div id="toc" class="toc" role="navigation" aria-labelledby="mw-toc-heading"><input type="checkbox" role="button" id="toctogglecheckbox" class="toctogglecheckbox" style="display:none" />
<ul>



</ul>
</div>

</td></tr></tbody></table>
<h1><a name="Hugin_Masks_tab"><span class="mw-headline">Hugin Masks tab</span></a></h1>
<p>The <b>Hugin Masks tab</b> has two functions:
</p>
<ul><li>Creating <b>masks</b> for individual images that include or exclude specific parts of these individual images in your final panorama.</li>
<li><b>Cropping</b> one or more of your individual images, as you would do for, e.g., <a href="Fisheye_Projection.html" title="Fisheye Projection">fisheye Projection</a> images having a circular area in the middle with a useless black area outside, or scanned images that might have edges that need to be <i>cropped</i> away.</li></ul>
<p>The top-left side of the masks window shows a list of all images in the current project. 
</p><p>The <b>Masks</b> tab has in the mid-section on the left side two sub-tabs <i>Masks</i> and <i>Crop</i>, each with its own functionality. Note that you have to select an image in the top left before the functionality of both will be enabled.
</p>
<h1><a name="Masks"><span class="mw-headline">Masks</span></a></h1>
<p>The blender (default is <a href="Enblend.html" title="Enblend">Enblend</a>) may place a seam on any part of the overlap between photos. This can result in a person or object being cut by the seam and only partly appearing in the final stitch. Blend masking allows you to define an <b>include</b> region which the blender will try to incorporate into the final stitch, as well as an <b>exclude</b> region which the blender will try to keep out of the stitch.
</p><p>Blend masks are not like normal "cut and paste" masking. They are more like hints for the blender. Therefore it is not always necessary to carefully define a mask exactly on the boundary of an object. Often it sufficient to roughly enclose the area to be included or excluded. Be careful to exclude a part of one photo only if some other photo shows the same part of the scene, otherwise you will get a black empty area in your final panorama.
</p><p>Masks can be saved and reloaded.
</p><p>The top-left side of the masks window shows a list of all images in the current project. The listbox below shows all masks of the active image. 
</p>
<h2><a name="Creating_a_mask_polygon"><span class="mw-headline">Creating a mask polygon</span></a></h2>
<p>After selecting <b>add new mask</b> set polygon points with left mouse click. Finish polygon with right mouse button click or double left click.
</p>
<h2><a name="Deleting_a_mask"><span class="mw-headline">Deleting a mask</span></a></h2>
<p>You can delete the active mask by selecting it and clicking the <b>Delete mask</b> button by the listbox on the left. You can also use your <b>delete</b> key when all or none of the points of the current mask are selected.
</p>
<h2><a name="Selecting_a_mask"><span class="mw-headline">Selecting a mask</span></a></h2>
<p>There are 3 ways to select a mask:
</p>
<ul><li>left mouse click inside polygon</li>
<li>use rubberband around polygon, this works only when the active polygon has no selected points</li>
<li>click on the polygon in the listbox on the left</li></ul>
<h2><a name="De-selecting_a_mask"><span class="mw-headline">De-selecting a mask</span></a></h2>
<p>Click somewhere not on the mask's row in the listbox on the left.
</p>
<h2><span id="Selecting_point(s)"></span><a name="Selecting_point.28s.29"><span class="mw-headline">Selecting point(s)</span></a></h2>
<p>You can select points of the active polygon by clicking on it. To select several points use a rubberband around all points. When holding down the shift key, the newly selected points are added to the existing selection.
</p><p>Note that Hugin uses some "fuzzy" logic when working with mask points. If your masks get too small, you may see some unusual behavior when editing masks. Since masks do not have to be extremely precise, this should not cause any major problems, but it is good to keep in mind.
</p>
<h2><span id="De-selecting_point(s)"></span><a name="De-selecting_point.28s.29"><span class="mw-headline">De-selecting point(s)</span></a></h2>
<p>Click in the image away from the mask, or re-click on the mask in the listbox on the left side. The mask will remain selected, but individual points will not be.
</p>
<h2><span id="Moving_point(s)"></span><a name="Moving_point.28s.29"><span class="mw-headline">Moving point(s)</span></a></h2>
<p>To move a point, simply drag it after clicking on it with the left mouse button. This also works when more then one point is selected.
</p>
<h2><a name="Moving_the_whole_mask"><span class="mw-headline">Moving the whole mask</span></a></h2>
<p>If you want to move the whole mask, drag from within the mask with the right mouse button.
</p>
<h2><a name="Adding_points"><span class="mw-headline">Adding points</span></a></h2>
<p>You can add a new point to the mask polygon by clicking on a line segment with left mouse button while holding down the control key (command on a Mac). Until you release the left mouse button, you can also directly move the newly created point.
</p>
<h2><a name="Deleting_points"><span class="mw-headline">Deleting points</span></a></h2>
<p>You can delete a single point of the active polygon by a right mouse click while holding down the control key (command on a Mac) on a point. To delete multiple points drag a rectangle/rubberband with the right mouse button while holding down the control key (command on a Mac) around the points. When you press the delete key the selected points are deleted.
</p><p>Note that if the remaining polygon would consists of fewer than three points, the delete operation is canceled.
</p>
<h2><a name="Masks_and_Control_Points"><span class="mw-headline">Masks and Control Points</span></a></h2>
<p>While <a href="Control_points.html" title="Control points">control points</a> inside masks are still used in geometric optimization, you can use masks to eliminate unwanted control points:
</p>
<ul><li>Create a mask before calling <a href="Cpfind.html" title="Cpfind">cpfind</a>. Cpfind will respect the masks and will not create cp in these areas. This is the preferred way, because cpfind will now distribute all control points in unmasked area only.</li>
<li>Remove control points within masks with the menu command: Edit &gt; Remove control points in mask. As a result it can be possible to remove all control points between one image pair.</li></ul>
<p>The photometric optimizer takes the masks automatically into account.
</p>
<h1><a name="Cropping_images"><span class="mw-headline">Cropping images</span></a></h1>
<p><i>Image cropping</i> shouldn't be confused with a camera's <a href="Crop_factor.html" title="Crop factor">Crop factor</a>, which is something else entirely. Use the <b>Crop</b> tab to indicate the areas of the input images that <a href="Hugin.html" title="Hugin">hugin</a> should exclude from the stitching output. There are three situations where you might want to use crop parameters:
</p>
<ul><li>With a scanned input image, there are usually black edges or marks along the sides of the image.</li>
<li>With a circular <a href="Fisheye_Projection.html" title="Fisheye Projection">Fisheye Projection</a> image there are black unexposed areas outside the image circle.</li>
<li>Some lenses have a lot of flaring around the edges which you don't want to keep.</li></ul>
<p>Select the image to be cropped in the list to the left, you can adjust the position of the crop area by dragging the perimeter in the image preview on the right.  Multiple images can be selected by holding down the <i>Shift</i> or <i>Ctrl</i> keys while clicking in the image list. Then the selected crop is applied to all images.
</p><p>Note that unlike PTGui<a class="external" href="https://wiki.panotools.org/PTGui">[*]</a>, setting crop parameters<a class="external" href="https://wiki.panotools.org/Crop_parameters">[*]</a> in hugin doesn't change the <a href="Field_of_View.html" title="Field of View">Field of View</a> or optical centre of your images, it simply indicates areas of the image to be masked out, so you can change the cropping for photos in your project at any stage of the stitching process.
In detail, <a href="Hugin.html" title="Hugin">hugin</a> uses the <b>S</b> 'selection' parameter in the <b>i</b> and <b>o</b> script lines instead of the <b>C</b> 'crop' parameter.
</p><p>Depending on the input image type, cropping has two different behaviours:
</p>
<ul><li>For circular fisheye photos the crop area is a circle.</li>
<li>For any other input image, the crop area is a rectangle.</li></ul>
<p>Change the input image type in the <a href="Hugin_Photos_tab.html" title="Hugin Photos tab">Hugin Photos tab</a> or in the <a href="Hugin_Assistant_tab.html" title="Hugin Assistant tab">Hugin Assistant tab</a>.
</p><p>The <b>Crop</b> tab features four text boxes for <b>Left</b>, <b>Top</b>, <b>Right</b> and <b>Bottom</b> where you can manually enter the positions of the four edges.  The origin is top-left and numbers indicate the distance in pixels from this origin.
</p><p>Note that numbers can be negative and can extend beyond the width and height of the photo, this is primarily useful for partial fisheye images where the full circle is not visible, in this case the crop circle extends beyond the picture frame.
</p><p>The default <b>Always center Crop on d,e</b> assumes that all cropping is symmetrical around the optical centre of the lens.  This is normal unless you are using the crop feature to remove lens flare, in which case the crop may need to be asymmetrical.
</p><p>The <b>d</b> and <b>e</b> lens parameters setting the position of the optical centre are used by the <a href="Lens_correction_model.html" title="Lens correction model">Lens correction model</a> and are set in the <a href="Hugin_Photos_tab.html" title="Hugin Photos tab">Hugin Photos tab</a>.
</p>
<h2><a name="Save_and_apply_crop_values"><span class="mw-headline">Save and apply crop values</span></a></h2>
<p>Usually crop values don't vary too much for each lens/camera combination. So instead of always creating an almost same crop for new projects these values can be saved using the 'Save lens...' button in the <a href="Hugin_Photos_tab.html" title="Hugin Photos tab">Hugin Photos tab</a> tab. 
</p><p>To load crop values just select one image in the 'Camera and Lens' tab and load the previously saved lens description file. That also sets the crop for all images in the project that have the same lens number. 
</p><p>The lens description file is a plain text file with a .ini extension.
</p>

<!--
Transclusion expansion time report (%,ms,calls,template)
100.00%    0.000      1 -total
-->


</div></div><div class="printfooter">Retrieved from "<a dir="ltr" href="https://wiki.panotools.org/index.php?title=Hugin_Mask_tab&amp;oldid=15671">https://wiki.panotools.org/index.php?title=Hugin_Mask_tab&amp;oldid=15671</a>"</div>
		</div></div></body></html>